﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/HomePage.master" AutoEventWireup="true" CodeFile="Contact.aspx.cs" Inherits="Pages_Contact" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderFlash" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContent" Runat="Server">
 <div id="component-contact">
        <table cellspacing="0" cellpadding="0" border="0" width="100%" class="contentpaneopen">
            <tbody>
                <tr>
                    <td width="100%" class="contentheading">
                        <asp:Literal ID="ltrTitle" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Literal ID="ltrSummary" runat="server"></asp:Literal>
                        <br>
                        <br>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Literal ID="ltrContent" runat="server"></asp:Literal>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <br>
                        <br>
                        <div class="contact_email">
                            <label for="contact_name" id="yourname">
                                &nbsp;Enter your Name:
                            </label>
                            <br>
                            <asp:TextBox ID="txtName" class="inputbox" size="30" runat="server"></asp:TextBox>
                            <br>
                            <label for="contact_email" id="contact_emailmsg">
                                &nbsp;E-mail address:
                            </label>
                            <br>
                            <asp:TextBox ID="txtEmail" MaxLength="100" class="inputbox" size="30" runat="server"></asp:TextBox>
                            <br>
                            <label for="contact_subject" id='subject'>
                                &nbsp;Message Subject:
                            </label>
                            <br>
                            <asp:TextBox ID="txtsubject" class="inputbox" size="30" runat="server"></asp:TextBox>
                            <br>
                            <br>
                            <label for="contact_text" id="contact_textmsg">
                                &nbsp;Enter your Message:
                            </label>
                            <br>
                            <textarea class="inputbox required" id="contact_text" name="text" rows="10" cols="50"
                                runat="server"></textarea>
                            <br>
                            <asp:CheckBox ID="cbCopy" runat="server" />
                            <label for="contact_email_copy">
                                E-mail a copy of this message to your own address.
                            </label>
                            <br>
                            <br>
                            <asp:Button ID="btnSubmit" OnClientClick="if(!CheckNull())return false;" runat="server"
                                Text="Send" class="button validate" onclick="btnSubmit_Click" />
                        </div>
                        <br>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <script language="javascript" type="text/javascript">
        function CheckEmail(__Email) {
            return __Email.search(/^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-z]{2,4}$/i) == -1 ? false : true;
        }
        CheckNull = function () {
            var control = document.getElementById('<%=txtName.ClientID %>');
            if (control.value.length <= 0) {
                control.className = 'inputbox required validate-email invalid';
                document.getElementById('yourname').className = 'invalid';
                control.focus();
                return false;
            }
            document.getElementById('yourname').className = '';
            control.className = 'inputbox';
            control = document.getElementById('<%=txtEmail.ClientID %>');
            if (control.value.length <= 0 || !CheckEmail(control.value)) {
                control.className = 'inputbox required validate-email invalid';
                document.getElementById('contact_emailmsg').className = 'invalid';
                control.focus();
                return false;
            }
            document.getElementById('contact_emailmsg').className = '';
            control.className = 'inputbox';

            control = document.getElementById('<%=txtsubject.ClientID %>');
            if (control.value.length <= 0) {
                control.className = 'inputbox required validate-email invalid';
                document.getElementById('subject').className = 'invalid';
                control.focus();
                return false;
            }
            document.getElementById('subject').className = '';
            control.className = 'inputbox';
            control = document.getElementById('<%=contact_text.ClientID %>');
            if (control.value.length <= 0) {
                control.className = 'inputbox required validate-email invalid';
                document.getElementById('contact_textmsg').className = 'invalid';
                control.focus();
                return false;
            }
            document.getElementById('contact_textmsg').className = '';
            control.className = 'inputbox';
            return true;
        }
    </script>
</asp:Content>

